package com.zz.tijian.handle.mq;

import com.zz.tijian.entity.Orders;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RefundProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendRefundMessage(Integer orderId) {
        //TODO 后续开启消息发送确认机制
        rabbitTemplate.convertAndSend(RabbitMQConfig.REFUND_EXCHANGE, RabbitMQConfig.REFUND_ROUTING_KEY, orderId);
    }
}
